﻿// ===============================================================================
// XCI.NET 西安交通信息WinForm开发框架 2018 版权所有
// ===============================================================================
using System;
using XCI.Core;

namespace XCI.Windows
{
    /// <summary>
    /// 组件对象信息
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
    public class ComponentCaptionAttribute : Attribute
    {
        /// <summary>
        /// 说明
        /// </summary>
        [ApiModelProperty(Caption = "说明")]
        public string Caption { get; internal set; }

        /// <summary>
        /// 名称
        /// </summary>
        [ApiModelProperty(Caption = "名称")]
        public string Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        [ApiModelProperty(Caption = "编码")]
        public string Code { get; set; }

        /// <summary>
        /// 是否可见
        /// </summary>
        [ApiModelProperty(Caption = "可见")]
        public bool Visible { get; set; } = true;

        /// <summary>
        /// 简拼
        /// </summary>
        public string NameSpell { get; set; }

        /// <summary>
        /// 初始化 ComponentCaptionAttribute 类的新实例。
        /// </summary>
        public ComponentCaptionAttribute()
        {
        }

        /// <summary>
        /// 初始化 ComponentCaptionAttribute 类的新实例。
        /// </summary>
        public ComponentCaptionAttribute(bool visible)
        {
            Visible = visible;
        }

        /// <summary>
        /// 初始化 ComponentCaptionAttribute 类的新实例。
        /// </summary>
        /// <param name="caption">说明</param>
        public ComponentCaptionAttribute(string caption)
        {
            this.Caption = caption;
        }
    }

    /// <summary>
    /// 窗口组件对象信息
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
    public class FormCaptionAttribute : ComponentCaptionAttribute
    {
        /// <summary>
        /// 初始化 FormCaptionAttribute 类的新实例。
        /// </summary>
        public FormCaptionAttribute()
        {
        }

        /// <summary>
        /// 初始化 FormCaptionAttribute 类的新实例。
        /// </summary>
        public FormCaptionAttribute(bool visible) : base(visible)
        {
        }

        /// <summary>
        /// 初始化 FormCaptionAttribute 类的新实例。
        /// </summary>
        /// <param name="caption">说明</param>
        public FormCaptionAttribute(string caption) : base(caption)
        {
        }
    }
}